home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 1.iso / dist / patchSG0003743.idb / usr / include / cray / assign.h.z / assign.h
C/C++ Source or Header  |  2001-04-12  |  19KB  |  633 lines

  1. /* USMID @(#) clibinc/cray/assign.h    92.2    12/18/98 09:49:04 */
  2. /*
  3.  *    (C) COPYRIGHT CRAY RESEARCH, INC.
  4.  *    UNPUBLISHED PROPRIETARY INFORMATION.
  5.  *    ALL RIGHTS RESERVED.
  6.  */
  7.  
  8. #ifndef _CRAY_ASSIGN_H
  9. #define _CRAY_ASSIGN_H
  10.  
  11.  
  12. #ifndef    _LIB_INTERNAL
  13. #define    _LIB_INTERNAL 1        /* expose internal FFIO definitions */
  14. #endif
  15. #include <ffio.h>
  16. #include <liberrno.h>
  17. #include <stddef.h>
  18. #include <stdio.h>
  19. #include <cray/fortio.h>
  20. #include <cray/mtlock.h>
  21. #include <sys/param.h>
  22.  
  23.  
  24. /************************************************************************
  25.  *                                    *
  26.  *    CONSTANTS                             *
  27.  *                                    *
  28.  ************************************************************************/
  29.  
  30.  
  31. /*
  32.  * Assign option values.
  33.  */
  34.  
  35. #define AS_SKIPBAD    1        /* -d skipbad */ 
  36. #define AS_ACPTBAD    2        /* -d acptbad */ 
  37.  
  38. #define AS_FORTRAN77    1        /* -f 77 */ 
  39. #define AS_FORTRAN90    2        /* -f 90 */
  40. #define AS_IRIX_F77    3        /* -f irixf77 */ 
  41. #define AS_IRIX_F90    4        /* -f irixf90 */
  42.  
  43. #define AS_THREAD    1        /* -P thread */
  44. #define AS_PROCESS    2        /* -P process */
  45. #define AS_TEAM        3        /* -P team */
  46. #define AS_PRIVATE    4        /* -P private */
  47. #define AS_GLOBAL    5        /* -P global */
  48.  
  49. /*
  50.  * Other constants.
  51.  */
  52.  
  53. #define BYFILE        'f'
  54. #define BYGLOBAL    'g'
  55. #define BYPATTERN    'p'
  56. #define BYUNIT        'u'
  57.  
  58. #define MAX_FDC_SPEC    128        /* max words in an FDC specification */
  59.  
  60. #define MAX_ASSIGN_LINE    5000        /* maximum number of characters in an */
  61.                     /* assign record.  This number must   */
  62.                     /* be comfortably greater than           */
  63.                     /* (PATH_MAX * 4 + MAX_FDC_SPEC)      */
  64.                     /* as long as the hybrid assign env   */
  65.                     /* file format is supported (through  */
  66.                     /* UNICOS 7.0?).  After that time,    */
  67.                     /* this constant may be reduced to    */
  68.                     /* (PATH_MAX * 2 + MAX_FDC_SPEC + pad)*/
  69.  
  70. #define    DECIMAL        10        /* for strtol */
  71.  
  72. #define AE_LIB        1        /* call from assign lib routines */
  73. #define AE_ASSIGN    2        /* call from assign command */
  74. #define AE_ASGCMD    3        /* call from asgcmd command */
  75.  
  76. /*
  77.  *    Strings and characters
  78.  */
  79.  
  80. #define ASSIGN_ENV_VAR    "FILENV"    /* pointer to assign environment */
  81. #define ASSIGN_OPT_VAR    "_LIBASSIGNENV_"/* default asn environment repository */
  82. #define ASGCMD_ENV_VAR    "_ASG_ATTR"    /* location of asgcmd attributes */
  83. #define PROCENVFLAG    '$'        /* indicate an environment var name */
  84. #define DELIMSTR    " # # "        /* delimiter in environment strings */
  85.  
  86. /*
  87.  *    Mask bits which identify searches for g:all/sf/su/df/du/aq/ff/mpi
  88.  *    assign objects.
  89.  */
  90.  
  91. #define    ASN_G_ALL     0001
  92. #define    ASN_G_SF     0002
  93. #define    ASN_G_SU     0004
  94. #define    ASN_G_DF     0010
  95. #define    ASN_G_DU     0020
  96. #define    ASN_G_AQ     0040
  97. #define    ASN_G_FF     0400
  98. #define    ASN_G_MPI    01000
  99.  
  100. /************************************************************************
  101.  *                                    *
  102.  *    MACROS used by internal assign parsing                 *
  103.  *                                    *
  104.  ************************************************************************/
  105.  
  106. #define RETERR(_EH,_NUM)    {    \
  107.     _lerror(_EH,_NUM);        \
  108.     errno    = _NUM;            \
  109.     return(-1);            \
  110. }
  111. #define RETERR1(_EH,_NUM,_D1)    {    \
  112.     _lerror(_EH,_NUM,_D1);        \
  113.     errno    = _NUM;            \
  114.     return(-1);            \
  115. }
  116. #define RETERR2(_EH,_NUM,_D1,_D2) {    \
  117.     _lerror(_EH,_NUM,_D1,_D2);    \
  118.     errno    = _NUM;            \
  119.     return(-1);            \
  120. }
  121. #define ERRET(ee) { errno = ee; return(-1); }
  122.  
  123. /*
  124.  * ASSIGN_LOCK    protects multitasked programs when executing in sensitive
  125.  *        areas in assign library routines.   ASSIGN_LOCK must be
  126.  *        called whenever:
  127.  *
  128.  *            (1)    - the assign environment file is open.  File updates
  129.  *              across unrelated processes are forced as 
  130.  *              single-threaded by file locking.   For tasks in
  131.  *              a multitasked group or multiple tasks/PEs on an MPP, 
  132.  *              file locking will not cause one task to wait for a 
  133.  *              lock held by another task.  So a multitasking lock 
  134.  *              is needed too.
  135.  *
  136.  *    (non-MPP)   (2)    - the local assign environment is being accessed.
  137.  *              The local assign environment is global to all tasks
  138.  *              and must be accessed by a single task at a time.
  139.  *              The local assign environment is enabled when ASNCTL 
  140.  *              is called with the 'LOCAL' or 'NEWLOCAL' options.
  141.  *
  142.  *    (non-MPP)   (3)    - fopen() or fclose() are called for the assign 
  143.  *              environment file.   This ensures that updates to
  144.  *              the __iob table are single threaded.  Note that
  145.  *              (1) implies (3).
  146.  *
  147.  * ASSIGN_UNLOCK Unlocks the assign library lock.
  148.  */ 
  149.  
  150. #ifndef    _CRAYMPP
  151.  
  152. #define ASSIGN_LOCK()        MEM_LOCK(&_Ae_assign_lock)
  153. #define ASSIGN_UNLOCK()        MEM_UNLOCK(&_Ae_assign_lock)
  154.  
  155. #else    /* _CRAYMPP */
  156.  
  157. #define ASSIGN_LOCK()        { if (_num_pes() > 1) \
  158.                     MPP_LOCK(&_Ae_assign_lock); }
  159. #define ASSIGN_UNLOCK()        { if (_num_pes() > 1) \
  160.                     MPP_UNLOCK(&_Ae_assign_lock); }
  161.  
  162. #endif    /* _CRAYMPP */
  163.  
  164. /*
  165.  * _AE_SKIPWHITE - skips spaces and tabs.
  166.  */
  167. #define _AE_SKIPWHITE(pp) { \
  168.     register char    cc;            \
  169.     cc    = *pp;                \
  170.     while (isspace(cc) && cc != '\0')    \
  171.         cc    = *++pp;        \
  172. }
  173.  
  174.  
  175. /*
  176.  * _AE_NULLINFO - sets an assign_info structure to contain no attributes.
  177.  */
  178. #define _AE_NULLINFO(P)    ((void)memset((char*)P,0,sizeof(assign_info)))
  179.  
  180. /*
  181.  * Assign debugging macros.   Define DEBUG_ASSIGN to activate these macros.
  182.  */
  183. #ifdef    DEBUG_ASSIGN
  184. #define ASN_DEBUG( ARGLIST )    printf ARGLIST
  185. #else
  186. #define ASN_DEBUG( ARGLIST )
  187. #endif
  188.  
  189. /*
  190.  * AFLAGSIZE    number of words in the flags part of the assign_info
  191.  *        structure.  Includes flagpad to allow compatibility
  192.  *        of mismatched libu and libf (in some cases).
  193.  */
  194. #define AFLAGSIZE ((offsetof(assign_info, flagpad) +            \
  195.            sizeof(((assign_info*) 0)->flagpad)) ) 
  196.  
  197. /*
  198.  * _ae_opt_control    - returns 1 if a letter is a control option 
  199.  *
  200.  * _ae_opt_noptval    - returns 1 if a letter is an option which does
  201.  *              not take an option value 
  202.  *
  203.  * _ae_opt_optval    - returns 1 if a letter is an option which takes
  204.  *              an option value which is not an integer or
  205.  *              merely "off"/"on".
  206.  */
  207. #define _ae_opt_control(ch)  \
  208.     ((ch)>='A' && (ch)<='z' && _Ae_letters[(ch)-'A'] == 'c')
  209.  
  210. #define _ae_opt_nooptval(ch) \
  211.     ((ch)>='A' && (ch)<='z' && _Ae_letters[(ch)-'A'] == 'n')
  212.  
  213. #define _ae_opt_optval(ch) \
  214.     ((ch)>='A' && (ch)<='z' && _Ae_letters[(ch)-'A'] == 'v')
  215.  
  216.  
  217. /************************************************************************
  218.  *                                    *
  219.  *    STRUCTURE DEFINITIONS                         *
  220.  *                                    *
  221.  ************************************************************************/
  222.  
  223. typedef struct {
  224.     char    type;            /* BYUNIT    - unit              */
  225.                     /* BYFILE    - file name           */
  226.                     /* BYGLOBAL    - g:XXX              */
  227.                     /* BYPATTERN    - file name pattern   */
  228.     union {
  229.         long    unit;        /* for assign by unit */
  230.         char    *str;        /* for other types of assign objects */
  231.     } u;                
  232. } assign_obj_id;
  233.  
  234. /*
  235.  * assign_info         - this structure is used for returning assign
  236.  *              environment information (attributes) for a particular 
  237.  *              assign object to the user.
  238.  *
  239.  *              The *_flg fields have the fillowing flags which
  240.  *              might be set:
  241.  *
  242.  *                ATTR_SET    - attribute is specified
  243.  *                ATTR_USED    - attribute has been used
  244.  *
  245.  *              The ATTR_SET bit is set during assign parsing.  The
  246.  *              ATTR_USED bit is for the convenience of library
  247.  *              open processing.
  248.  */
  249. enum asn_flags {
  250.     ATTR_SET    = 1,
  251.     ATTR_USED    = 2
  252. };
  253.  
  254. typedef unsigned char aflg_t;
  255.  
  256. typedef struct assign_info_s {
  257.  
  258.     aflg_t    a_actfil_flg;    
  259.     aflg_t    a_sdsfil_flg;    
  260.     aflg_t    b_bufsiz_flg;    
  261.     aflg_t    B_direct_flg;
  262.     aflg_t    c_contig_flg;        
  263.     aflg_t    C_chrcnv_flg;
  264.     aflg_t    d_datrcv_flg;
  265.     aflg_t    D_fildes_flg;
  266.     aflg_t    f_fortst_flg;    
  267.     aflg_t    F_filter_flg;    
  268.     aflg_t    l_buflev_flg;
  269.     aflg_t    L_ldraw_flg;
  270.     aflg_t    m_multup_flg;
  271.     aflg_t    n_preall_flg;
  272.     aflg_t    n_stride_flg;
  273.     aflg_t    N_datcnv_flg;
  274.     aflg_t    o_UNUSED_flg;
  275.     aflg_t     P_ioscop_flg;
  276.     aflg_t    q_ocblks_flg;
  277.     aflg_t    pr_partit_flg;
  278.     aflg_t    r_raw_flg;
  279.     aflg_t    s_fstrct_flg;    
  280.     aflg_t    S_comsep_flg;    
  281.     aflg_t    t_tmpfil_flg;
  282.     aflg_t    T_utrunc_flg;
  283.     aflg_t    u_bufcnt_flg;
  284.     aflg_t    U_unicoslist_flg;
  285.     aflg_t    w_welfrm_flg;
  286.     aflg_t    W_compwidth_flg;
  287.     aflg_t    x_parallel_flg;
  288.     aflg_t    y_reptcnt_flg;
  289.     aflg_t    Y_nl_skip_flg;
  290.     aflg_t    Z_neg_zero_flg;
  291.  
  292.     aflg_t    flagpad[9];    /* marker & pad for end of flags */
  293.  
  294.     char    a_actfil[PATH_MAX];    /* -a option.                  */
  295.                     /* Actual file opened when this          */
  296.                     /* file or unit appears in an OPEN.   */
  297.                     /* -a SDS option.              */
  298.                     /* Indicates SDS file.              */
  299.  
  300.     int    b_bufsiz;        /* -b option.                  */
  301.                     /* Requested size of library buffer   */
  302.                     /* in 512-word blocks.              */
  303.  
  304.     int    B_direct;        /* -B option                  */
  305.                     /* When == 1, set O_DIRECT on          */
  306.                     /* open(2) system call.              */
  307.  
  308.     int    c_contig;        /* -c option. (this field not used)   */
  309.  
  310.     int    C_chrcnv;        /* -C options.                     */
  311.                     /* Character conversion    code.          */
  312.  
  313.     int    d_datrcv;        /* -d option.                  */
  314.                     /* AR_SKIPBAD or AR_ACPTBAD          */
  315.                     /* Bad data recovery options.          */
  316.  
  317.     int    D_fildes;        /* -D option                  */
  318.                     /* Connect to file descriptor          */
  319.  
  320.     int    f_fortst;        /* Fortran 77 or 90 conformancy          */
  321.  
  322.     union spec_u            /* -F option                  */
  323.         F_filter[MAX_FDC_SPEC];    /* Binary filter specification.          */
  324.     int    F_filter_len;        /* Size of the filter spec (in words) */
  325.  
  326.     int    l_buflev;        /* -l option.                  */
  327.                     /* System buffering indicator.          */
  328.                     /* 1 indicates to open file to use    */
  329.                     /* the system I/O buffers.   0 means  */
  330.                     /* open the file in RAW mode.          */
  331.  
  332.     int    L_ldraw;        /* -L option.                  */
  333.                     /* When == 1, set O_LDRAW on          */
  334.                     /* open(2) system call.              */
  335.  
  336.     int    m_multup;         /* -m option.                  */
  337.                     /* When == 1, a direct access file    */
  338.                     /* may suppress a truncation at       */
  339.                     /* logical size at close time.        */
  340.  
  341.     int    n_preall;        /* -n option.                  */
  342.                     /* Pre-allocation size in 512-word    */
  343.                     /* blocks.                  */
  344.  
  345.     int    n_stride;        /* -n option.                  */
  346.                     /* Pre-allocation stride accross      */
  347.                     /* stripe partitions.  Only available */
  348.                     /* on the YMP.                  */
  349.  
  350.     int    N_datcnv;        /* -N options.                      */
  351.                     /* Numeric conversion    code.          */
  352.  
  353.     int    o_UNUSED;        /* no longer used              */
  354.  
  355.     long    pr_partit;        /* -p option.                  */
  356.                     /* Bit mask indicating which          */
  357.                     /* partitions of the file system to   */
  358.                     /* which the system should attempt    */
  359.                     /* to allocate the file.          */
  360.  
  361.     int     P_ioscop;        /* -P option.                  */
  362.                     /* When == 'p' Fortran units are      */
  363.                     /* private to a task.  When == 'g'    */
  364.                     /* Fortran units are global.          */
  365.  
  366.     int    q_ocblks;         /* -q option.                  */
  367.                     /* cblks value for open(2) sys call   */
  368.  
  369.     int    r_raw;            /* -r option.                  */
  370.                     /* When == 1, set O_RAW on          */
  371.                     /* open(2) system call.              */
  372.  
  373.     int    s_fstrct;        /* -s option.                  */
  374.                     /* File structure code.              */
  375.  
  376.     int    S_comsep;        /* -S option.                  */
  377.                     /* Use comma as the list-directed     */
  378.                     /* output separator.  Default on      */
  379.                     /* UNICOS.                  */
  380.  
  381.     int    t_tmpfil;        /* -t option. (this field not used)   */
  382.  
  383.     int    T_utrunc;         /* -T option.                  */
  384.                     /* When == 1, a sequential Fortran    */
  385.                     /* file is truncated after writes.    */
  386.  
  387.     int    u_bufcnt;        /* -u option.                  */
  388.                     /* Requested number of library          */
  389.                     /* buffers to use for a direct-access */
  390.                     /* file.                   */
  391.  
  392.     int    U_unicoslist;        /* -U option.                  */
  393.                     /* Produce UNICOS form of          */
  394.                     /* list-directed output on irix.      */
  395.                     /* Default on UNICOS.              */
  396.                     /* This includes -S, -W, and -y.      */
  397.  
  398.     int    w_welfrm;        /* -w option.                  */
  399.                     /* When == 1, set O_WELLFORMED on     */
  400.                     /* open(2) system call.              */
  401.  
  402.     int    W_compwidth;        /* -W option.                  */
  403.                     /* Produce compressed width output    */
  404.                     /* for list-directed output on irix.  */
  405.                     /* Default on UNICOS.              */
  406.  
  407.     int    x_parallel;        /* -x option.                        */
  408.                     /* When == 1, set O_PARALLEL on          */
  409.                     /* open(2) system call.              */
  410.  
  411.     int     y_reptcnt;        /* -y option.                  */
  412.                     /* Produce repeat counts for          */
  413.                     /* list-directed output on irix.      */
  414.                     /* Default on UNICOS.              */
  415.     int     Y_nl_skip;        /* -Y option.                  */
  416.                     /* Skip unmatched namelist            */
  417.                     /* group name on input               */
  418.                     /* Default is off.              */
  419.     int     Z_neg_zero;        /* -Z option.                  */
  420.                     /* When on, print -0.0 if neg zero    */
  421.                     /* When off, print 0.0 if neg zero    */
  422.  
  423.     int    pad[10];         /* Pad space for future expansion     */
  424.  
  425. } assign_info;
  426.  
  427. typedef struct {
  428.     unsigned    I: 1;        /* -I option                 */
  429.     unsigned    O: 1;        /* -O option                 */
  430.     unsigned    R: 1;        /* -R option                 */
  431.     unsigned    V: 1;        /* -V option                 */
  432.     unsigned    v: 1;        /* -v option (command only)          */
  433.     unsigned    z: 1;        /* -z option (command only)          */
  434.     int        attrs;
  435. } assign_cntl;
  436.  
  437. typedef struct {
  438.     char    attrid;         /* letter identifying the attribute   */
  439.     char    *str;            /* attribute value (text string)      */
  440.     char    *p;            /* parsed data (optional)          */
  441. } attribute;
  442.  
  443. /*
  444.  * assign_record - this union is used to store assign records internally.
  445.  */
  446. typedef struct {
  447.     assign_obj_id        id;    /* assign object identifier           */
  448.     char            *attr;    /* pointer to list of attributes      */
  449. } assign_record;
  450.  
  451. /*
  452.  * assign_environment - a set of 0 or more assign_records.
  453.  */
  454. typedef struct {
  455.     int        rec_cnt;    /* Number of assign records in the    */
  456.                     /* assign environment.              */
  457.     int        rec_lim;    /* Space allocated for assign         */
  458.                     /* records.                      */
  459.     assign_record    *ar;        /* Pointer to list of assign_records  */
  460. } assign_environment;
  461.  
  462. /*
  463.  * aenv_stack - a stack of 0 or more assign_environments.
  464.  */
  465. typedef struct {
  466.     assign_environment      *env;   /* contiguous list of env's */
  467.     long                    size;   /* number of env's in stack */
  468. } aenv_stack;
  469.  
  470.  
  471. typedef struct {
  472.     int        iotype;        /* AE_FORTIO, AE_FFIO */
  473.     union {
  474.         struct {
  475.             char    access;        /* 's' or 'd' */
  476.             char    form;        /* 'f' or 'u' */
  477.         } fortio;
  478.         /* other types can be added here */
  479.     } u;
  480. } aio_desc;
  481.  
  482. /*
  483.  * tok_list         - identifies a list of valid option values and the
  484.  *                corresponding internal code value which corresponds 
  485.  *              to it.
  486.  */
  487. typedef struct tok_list_s {
  488.         char *str;
  489.         int  code;
  490. } tok_list;
  491.  
  492. /*
  493.  * opt_table         - identifies the location in the assign info 
  494.  *              structure where data is stored for an assign option.
  495.  *              It also points to the tok_list for this option.
  496.  */
  497. typedef struct opt_table_s {
  498.         int     flg_off;
  499.         int     val_off;
  500.         tok_list *tl;
  501. } opt_table;
  502.  
  503.  
  504. /*
  505.  * parse_info         - contains information for parsing all supported assign 
  506.  *              attribute options.
  507.  */
  508. typedef struct parse_info_s {
  509.         char            *optname;       /* option name ("-b", "-T")          */
  510.         int             flg_off;        /* location of opt flag bit           */
  511.         int             val_off;        /* location of opt value field        */
  512.         int (*          pfunc)();       /* option value parsing function      */
  513.         tok_list        *tl;            /* list of valid tokens if applicable */
  514.         unsigned        sup: 1;         /* 1 if supported on this system      */
  515.         char            *desc;          /* displayed usage string             */
  516. } parse_info;
  517.  
  518.  
  519. /************************************************************************
  520.  *                                    *
  521.  *    EXTERNS AND PROTOTYPES                        *
  522.  *                                    *
  523.  ************************************************************************/
  524.  
  525.  
  526. extern aenv_stack    _Ae_env_stack;
  527. extern int        _Ae_asgcmd;
  528. extern int        _Ae_assign_cmd;
  529. #ifndef _CRAYMPP
  530. EXTERN_LOCK(_Ae_assign_lock)
  531. #else
  532. EXTERN_MPP_LOCK(_Ae_assign_lock)
  533. #endif
  534. extern char         _Ae_letters[];
  535. extern parse_info    _Ae_option_parse_info[];
  536.  
  537. extern char *_ae_build_envstring(assign_environment *aep);
  538.  
  539. extern void  _ae_dealloc_env(assign_environment *aep);
  540.  
  541. extern void  _ae_dealloc_recflds(assign_record *arp);
  542.  
  543. extern int   _ae_externalize(int fromwhere, FILE *gfile,
  544.             assign_environment *ap);
  545.  
  546. extern int   _ae_externalize_file(FILE *gfile, assign_environment *ap);
  547.  
  548. extern int   _ae_externalize_env(int fromwhere, assign_environment *ap);
  549.  
  550. extern int   _ae_glob_code(char *str);
  551.  
  552. extern char *_ae_glob_str(int ga);
  553.  
  554. extern int   _ae_insert(assign_obj_id *aoidp, char *attr, int attrlen, 
  555.             assign_environment *aep);
  556.  
  557. extern int   _ae_internalize(FILE *gfile, assign_environment *aep);
  558.  
  559. extern int   _ae_internalize_file(FILE *gfile, assign_environment *aep);
  560.  
  561. extern int   _ae_internalize_env(assign_environment *aep, int ifasgcmd);
  562.  
  563. extern int   _ae_match_pattern(const char *fname, assign_record **arpp,
  564.             assign_environment *aep);
  565.  
  566. extern int   _ae_select(assign_obj_id *aoidp, assign_record **arpp,
  567.             assign_environment *aep);
  568.  
  569. extern void  _ae_setupenv(assign_environment *aep);
  570.  
  571. extern char  *_ae_glob_name(int ga);
  572.  
  573. extern int   _asndir_split(char *buf, char **options, char **object,
  574.             int ifasgcmd);
  575.  
  576. extern int   _assign(char *opt_string, assign_obj_id *aop, int errmode);
  577.  
  578. extern int   _assign_asgcmd_info(const char *fname, unum_t unum, int gamask,
  579.             assign_info *aip, char **atstr, int catcherr);
  580.  
  581. extern FILE *_gae_open(char acc_mode, char res_mode, int *status);
  582.  
  583. extern void  _gae_close(FILE *f);
  584.  
  585. extern int   _get_a_options(int ifasgcmd, const char *fname, unum_t unum,
  586.             int gamask, assign_info *aip, char **atstr,
  587.             int errmode);
  588.  
  589. extern char *_lae_get_assign_file_name(int *estat);
  590.  
  591. extern char *_lae_get_assign_var_name(void);
  592.  
  593. extern int   _lae_get_object(char *objtext, assign_obj_id *aoidp);
  594.  
  595. extern int   _patmatch(const char *str, const char *pat);
  596.  
  597. extern void  _unique_close(FILE *f);
  598.  
  599. extern FILE *_unique_open(char *fname, char mode, int *ostat);
  600.  
  601. extern int   _lae_do_assign(int fromwhere, int assign_mode, char open_mode,
  602.             char res_mode, assign_obj_id *aoidp,
  603.             char *attr_string, int optcheck, int errmode);
  604.  
  605. extern int   _lae_assign_mode(int fromwhere, assign_cntl *cnp, int numobj,
  606.             int *amode, char *omode, char *rmode);
  607.  
  608. extern int    _attrs_used(assign_info *aip, char **attrstr);
  609.  
  610. extern void    _attr_clear_used(assign_info *aip);
  611.  
  612. extern int    _ae_eclipse(char *attr1, int len1, char *attr2, int len2,
  613.         char **newarp);
  614.  
  615. extern int    _ae_parse(assign_obj_id *aiodp, char *attr, int attrlen,
  616.         assign_info *aip, int warnmode, int errmode);
  617.  
  618. extern int    _lae_process_opts(char *opt_string, char **attr_string, 
  619.         assign_cntl *cntlp);
  620.  
  621. extern int    _ae_delete(assign_record *arp, assign_environment *aep);
  622.  
  623. extern void    _lae_print_record(assign_record *arp);
  624.  
  625. extern int    _ae_next(assign_record *prev, assign_record **next, 
  626.         assign_environment *aep);
  627.  
  628. extern int    _ae_check_attr(assign_info *ai, int warnmode, int errmode);
  629.  
  630. extern void    _ae_setoflags(assign_info *aip, int *flagmask);
  631.  
  632. #endif    /* !_CRAY_ASSIGN_H */
  633.